﻿@model ChangePasswordModel

@using SmartStore.Web.Models.Customer;

@{
	Html.AddTitleParts(T("PageTitle.Account").Text);

	Layout = "_MyAccount";
	ViewBag.PageClassToken = "changepassword";
	ViewBag.PageTitle = T("Account.ChangePassword").Text;
}

@using (Html.BeginForm("ChangePassword", "Customer", FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()

	if (!ViewData.ModelState.IsValid)
	{
        @Html.ValidationSummary(true, "", new { @class = "alert alert-danger" })
    }

    if (!String.IsNullOrEmpty(Model.Result))
    {
        <div class="alert alert-info">
            @Model.Result
        </div>
    }

    <div class="form-group row">
        @Html.LabelFor(model => model.OldPassword, new { @class = "col-lg-4 col-form-label required" })
        <div class="col-lg-8">
            @Html.PasswordFor(model => model.OldPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.OldPassword)
        </div>
    </div>
    <div class="form-group row">
        @Html.LabelFor(model => model.NewPassword, new { @class = "col-lg-4 col-form-label required" })
        <div class="col-lg-8">
            @Html.PasswordFor(model => model.NewPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.NewPassword)
        </div>
    </div>
    <div class="form-group row">
        @Html.LabelFor(model => model.ConfirmNewPassword, new { @class = "col-lg-4 col-form-label required" })
        <div class="col-lg-8">
            @Html.PasswordFor(model => model.ConfirmNewPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(model => model.ConfirmNewPassword)
        </div>
    </div>

    <div class="form-group row">
        <div class="col col-sm-auto offset-sm-4 text-muted">
            @T("Common.FormFields.Required.Hint")
        </div>
    </div>

    <div class="form-group row">
        <div class="col">
            <button type="submit" class="btn btn-lg btn-primary">
                <i class="fa fa-check"></i>
                <span>@T("Account.ChangePassword.Button")</span>
            </button>
        </div>
    </div>
}